<% extends 'base.html' %>
<% block title %>绑定页面<% endblock %>
<% block body %>
<div class='page'>
    <div class="content">
        <% if partner %>
            <div class="list-block" ms-controller="binding-form">
                <input name='hidden' id='hidden_user' value='${user_id}' ms-visible='false' />
                <div class='content-block' ms-visible='no_partner'>
                    <div class='binding-form-info'><span>您的账户没有在系统后台登记</span><span>请联系系统管理员</span></div>
                </div>
                <% if user and not user.share %>
                <!-- 雇员绑定 -->
                <ul class="binding-form-employee" ms-visible='!no_partner'>
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title label">姓名</div>
                        <div class="item-input">
                          <input name='mobile' value="${contacts and contacts.name or partner.name}" type='tel' readonly='readonly' />
                        </div>
                      </div>
                    </li>
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title label">手机</div>
                        <div class="item-input">
                          <input name='mobile' value="${contacts and contacts.mobile or partner.mobile}" type='tel' readonly='readonly' />
                        </div>
                      </div>
                    </li>
                </ul>
                <div class='item-tips' ms-visible='!no_partner'>注：如资料有误请电话联系管理员</div>
                <% else %>
                <!-- 外部用户(客户绑定) -->
                <input type="hidden" name="share" value="1" />
                <ul class="binding-form-share" ms-visible='!no_partner'>
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title label">单位</div>
                        <div class="item-input">
                          <input name='mobile' value="${partner.name}" type='tel' readonly='readonly' />
                        </div>
                      </div>
                    </li>
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title label">姓名</div>
                        <div class="item-input">
                          <input name='mobile' value="${contacts and contacts.contacts_id.name or partner.name}" type='tel' readonly='readonly' />
                        </div>
                      </div>
                    </li>
                    <li class="item-content">
                      <div class="item-inner">
                        <div class="item-title label">手机</div>
                        <div class="item-input">
                          <input name='mobile' value="${contacts and contacts.contacts_id.mobile or partner.mobile}" type='tel' readonly='readonly' />
                        </div>
                      </div>
                    </li>
                </ul>
                <div class='item-tips' ms-visible='!no_partner'>注：如资料有误请电话联系客服</div>
                <% endif %>
                <!--<div ms-visible='tips'>-->
                    <!--<div class='item-tips'>您输入的手机号与当前用户的手机号不匹配</div>-->
                <!--</div>-->
                <div class="content-block" ms-visible='!no_partner'>
                    <% if not attention %>
                        <p>
                            <a href="#" class="button button-big button-fill active" ms-click="do_binding" ms-visible="!uid">确认绑定</a>
                        </p>
                        <div class="row" ms-visible="uid">
                            <div class='binding-form-info'><span>已经成功绑定到帐号{{mobile}}</span><span>按左上角返回键返回</span></div>
                        </div>
                    <% else %>
                        <div class="row" >
                            <div class='binding-form-info'><span>已经成功绑定到帐号{{mobile}}</span><span>按左上角返回键返回</span></div>
                        </div>
                        <p>
                            <a href="#" class="button button-big button-fill active" ms-click="do_binding">重新绑定</a>
                        </p>
                    <% endif %>
                </div>
            </div>
            <!-- end 绑定表单 -->
        <% else %>
            <div class="content-block">
                <div class='binding-form-info'><span>您未绑定账号</span><span>可能您的手机未登记，请联系客服。</span></div>
            </div>
        <% endif %>
    </div>
</div>
<% endblock %>

<% block script %>
    ${ super() }
    <script type="text/javascript" src="/dftg_weixin/static/src/js/binding.js"></script>
<% endblock %>
